package com.atlin.nrpc.core.registry;

import com.atlin.nrpc.core.config.RegistryConfig;
import com.atlin.nrpc.core.model.ServiceMetaInfo;

import java.util.List;

public interface Registry {

    void init(RegistryConfig registryConfig);

    void registry(ServiceMetaInfo serviceMetaInfo) throws Exception;

    void unRegistry(ServiceMetaInfo serviceMetaInfo) throws Exception;

    List<ServiceMetaInfo> serviceDiscovery(String serviceKey);

    void destroy();

    /**
     * 心跳检测（服务端）
     */
    void hearBeat();

    /**
     * 监听（消费端）
     *
     * @param serviceNodeKey
     */
    void watch(String serviceNodeKey);
}
